<?php

$db_reponse = new Model_User_Reponse();
if(!isset($_GET['rid'])){
    $rid = $_SESSION['rid'];
}else{   
    $rid = Utiles::getParam('rid', 'GET');
}
$info = explode('_',$rid);

$data = $db_reponse->getUserReponse($info[1]);
if($data['id_user_friend'] != $info['0'])
    echo("<script> top.location.href='access.php'</script>");

?>
<div id="fb-root"></div>
<script>
  (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/fr_FR/all.js#xfbml=1&appId=289694684387998";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like" data-href="https://apps.facebook.com/friendsplus_/access.php" data-send="false" data-width="450" data-show-faces="true"></div>
<div style="margin-bottom: 20px;width: 50px"></div>
<div id="header">
    <div class="avatar">
            <img class="photofb" src="https://graph.facebook.com/<?php print $current_user["id"]; ?>/picture" alt="avatar" />
            <span class="nom"><?php print $current_user['name'];?></span>
    </div>
</div>
<div id="fin_jeu">
    <div id="barre2">
            <div id="texte-barre">Question : <?php print $data['question'] ?></div>
    </div>
    <div id="contenu">
        <div class="contenuReponse">
            <div style="float: left; width: 128px;">
                <img src="/themes/img/Trophy_Gold.png" alt="Trophee" style="margin-left: 50px;" />
            </div>    
            <div style="float: right; width: 550px; padding-top: 64px;">
                <span class="sous_titre"><?php print utf8_decode($data['prenom'] . ' a répondu <strong> ' . $data['reponse']); ?></strong></span>
            </div>   
            <div style="clear:both; width: 550px; margin-left: 100px; padding-top: 50px;">
                <p class="sous_titre"></p>
            </div>   
            <div style="clear:both"></div>
        </div>
    </div>
    <div id="achievment">
        <ul id="nav">
<!--                <li><a href="#" class="rollover" onclick="postToFeed()">Publier</a></li>
                <li><a href="#" onclick="shareApp()">Partager</a></li>
                <li><a href="#" onclick="sendRequestViaMultiFriendSelector(); return false;">Inviter</a></li>-->
        </ul>
    </div>
    <div><a href="access.php">
        <img style="margin-left:260px;" src="/themes/img/jouer.png" alt="suivant" border="0" onmouseover="this.src='/themes/img/jouer2.png'" onmouseout="this.src='/themes/img/jouer.png'" a/>
        </a>
    </div>
</div>